package com.yxy.web.controller.os;

import com.yxy.common.core.controller.BaseController;
import com.yxy.common.core.domain.AjaxResult;
import com.yxy.common.core.domain.model.LoginUser;
import com.yxy.common.core.page.TableDataInfo;
import com.yxy.common.utils.SecurityUtils;
import com.yxy.system.domain.ReportTip;
import com.yxy.system.service.IReportTipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

;

/**
 * 报告提示Controller
 * 
 * @author 402844673@qq.com
 * @date 2025-08-28
 */
@RestController
@RequestMapping("/os/tip")
public class ReportTipController extends BaseController
{
    @Autowired
    private IReportTipService reportTipService;

    /**
     * 查询报告提示列表
     */
    @PreAuthorize("@ss.hasPermi('os:tip:list')")
    @GetMapping("/list")
    public TableDataInfo list(ReportTip reportTip)
    {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        if ("00".equals(loginUser.getUser().getUserType())){
            reportTip.setFixmedinsCode(loginUser.getUser().getDept().getFixmedinsCode());
        }
        startPage();
        List<ReportTip> list = reportTipService.selectReportTipList(reportTip);
        return getDataTable(list);
    }


    /**
     * 查询报告提示列表
     */
    @PreAuthorize("@ss.hasPermi('system:tip:info')")
    @GetMapping("/info")
    public AjaxResult info(Long id, String field)
    {
        return AjaxResult.success(reportTipService.feedbackDetail(id,field));
    }




}
